using UnityEngine;
using System.Collections;

public class Arma : MonoBehaviour 
{
	public Transform TiroPrefab;
	
	bool Atirar = true;

	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (Input.GetKeyDown(KeyCode.Mouse0))
		{			
			if (Atirar)
			{				
				Rigidbody bullet = Instantiate(TiroPrefab, transform.position + new Vector3(-0.5f, 0, -0.5f), transform.rotation) as Rigidbody;
				//bullet.velocity = transform.TransformDirection(new Vector3(0,0,100));				
			}
		}					
	}
}
